package com.nbsaas.boot;

/**
 * Hello world!
 *
 */
public class App 
{
    public static void main( String[] args )
    {
        System.out.println( "Hello World!" );

        PersonProto.Person person = PersonProto.Person.newBuilder()
                .setId(1)
                .setName("John Doe")
                .setEmail("john.doe@example.com")
                .build();

        // 序列化对象
        byte[] serializedData = person.toByteArray();

        // 反序列化对象
        try {
            PersonProto.Person deserializedPerson = PersonProto.Person.parseFrom(serializedData);
            System.out.println("ID: " + deserializedPerson.getId());
            System.out.println("Name: " + deserializedPerson.getName());
            System.out.println("Email: " + deserializedPerson.getEmail());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
